<?php
/*
* @Date: 2021-01-28 17:14:59
* @名称: 后台 · 漫画 · 获取 · 获取漫画列表 · 下一页
* @版本: 0.01
* @作者: 初雪桜
* @邮箱: 202184199@qq.com
* @最后编辑: 初雪桜
 * @LastEditTime: 2021-01-28 23:46:43
 * @FilePath: /Site/app/useradmin/controller/Comics/Get/Method/GetSonProject.php
*/

namespace app\useradmin\controller\Comics\Get;


use app\BaseController;
use think\facade\Db;

class GetSonProject extends BaseController
{
    /**
     * @方法名: 获取漫画子章节信息
     * @作者: 初雪桜
     * @信息: 显示某个漫画的子章节
     * @param Sting $bookId 漫画id
     * @return Json
     */
    public function GetSonProject($bookId)
    {
        // sleep(1);
        $comicsSonProject =  Db::table('book_info_project')
            ->where([
                "_id" => $bookId,
            ])
            ->field([
                "project_title", //分卷名称
                "chapter_id", //分卷id
                "updated_at", //更新时间
                "order", //分卷章节
            ])
            ->select();
        $comicsSonProject_count =  Db::table('book_info_project')
            ->where([
                "_id" => $bookId,
            ])
            ->count();
        return json([
            "comicsSonProject" => $comicsSonProject,
            "comicsSonProjectCount" => $comicsSonProject_count,
        ]);
    }
}
